<template>
    <base-breadcrumb title="分包招议标计划完成情况详情">
        <div class="details">
            <a-spin :spinning="loading">
                <div class="box">
                    <TitleName title="项目信息"></TitleName>
                    <div class="content">
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="分公司名称">
                                <span>{{ projectInfo.branchCompany }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="项目名称">
                                <span>{{ projectInfo.projectName }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                    </div>
                </div>
                <div class="box">
                    <TitleName title="分包招议标计划详情"></TitleName>
                    <div class="content">
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="状态">
                                <span>{{ biddingPlanDetails.biddingStatusName }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="招标合同额（万元）">
                                <span>{{ biddingPlanDetails.tenderContractMoney }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="分包商选择方式">
                                <span>{{ biddingPlanDetails.subcontractorsSelect }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="分包方式">
                                <span>{{ biddingPlanDetails.branchPackMode }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="计划招议标时间">
                                <span>{{ biddingPlanDetails.planBiddingTime }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="计划合同签订时间">
                                <span>{{ biddingPlanDetails.planContractTime }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="计划开工时间">
                                <span>{{ biddingPlanDetails.planTime }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="计划完工时间">
                                <span>{{ biddingPlanDetails.planEndTime }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="拟定队伍数量">
                                <span>{{ biddingPlanDetails.ranksNum }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="招标内容">
                                <span>{{ biddingPlanDetails.biddingContent }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions
                            v-if="biddingPlanDetails.biddingStatusCode == 4"
                            :column="{ md: 2, sm: 2 }"
                            style="padding: 0 20px"
                        >
                            <a-descriptions-item label="情况说明">
                                <span>{{ biddingPlanDetails.information }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="附件">
                                <b-upload uploadType="single" business-code="LCM16" disabled
                                          :file-list.sync="queryParam.planFileInfoVo"></b-upload>
                            </a-descriptions-item>
                        </a-descriptions>
                    </div>
                </div>
                <div class="box" v-if="biddingPlanDetails.biddingStatusCode != 1">
                    <div class="title">
                        <div class="minusicon">
                            <a-icon type="minus" class="icon" />
                        </div>
                        <span>分包招议标完成情况详情</span>
                    </div>
                    <div class="content">
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="分包商选择方式">
                                <span>{{ planCompleteDetails.subcontractorsSelect }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="招标合同额（万元）">
                                <span>{{ planCompleteDetails.tenderContractMoney }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="实际招标完成时间">
                                <span>{{ planCompleteDetails.biddingCompleteTime }}</span>
                            </a-descriptions-item>
                            <a-descriptions-item label="分包方式">
                                <span>{{ planCompleteDetails.branchPackMode }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="拟定队伍数量">
                                <span>{{ planCompleteDetails.teamsNum }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 1, sm: 1 }" style="padding: 0 20px">
                            <a-descriptions-item label="分包工程招标内容">
                                <span>{{ planCompleteDetails.biddingContent }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions :column="{ md: 1, sm: 1 }" style="padding: 0 20px">
                            <a-descriptions-item label="情况说明">
                                <span>{{ planCompleteDetails.biddingCompleteRemark }}</span>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions v-if="queryParam.completeFileInfoVo && queryParam.completeFileInfoVo.id" :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="附件">
                                <b-upload uploadType="single" business-code="MM01" disabled
                                          :file-list.sync="queryParam.completeFileInfoVo"></b-upload>
                            </a-descriptions-item>
                        </a-descriptions>
                        <a-descriptions v-if="queryParam.notCompleteFileInfoVo && queryParam.notCompleteFileInfoVo.id" :column="{ md: 2, sm: 2 }" style="padding: 0 20px">
                            <a-descriptions-item label="附件">
                                <b-upload uploadType="single" business-code="LCM16" disabled
                                          :file-list.sync="queryParam.notCompleteFileInfoVo"></b-upload>
                            </a-descriptions-item>
                        </a-descriptions>
                    </div>
                </div>
            </a-spin>
            <div class="operation page-btn-right-top" style="text-align: right" v-if="isApprove">
                <a-button @click="$close()"  v-checkVisibleInDetail >关闭</a-button>
            </div>
        </div>
    </base-breadcrumb>
</template>
<script>
import { getCompleteDetails } from '@/api/legal'
import TitleName from '@/components/TitleName/index.vue'

export default {
    components: {
        TitleName
    },
  name:'a'+Date.now(),
  data() {
        return {
            biddingPlanDetails: {},
            planCompleteDetails: {},
            projectInfo: {},
            queryParam: {},
            loading: false
        }
    },
    computed: {
        isApprove() {
            return window.location.href.indexOf('businessId') === -1
        }
    },
    created() {
        const ID = this.$route.query.id
        this.loading = true
        getCompleteDetails({ id: ID }).then((res) => {
            this.loading = false
            if (res.code === 200) {
                this.biddingPlanDetails = res.data.biddingPlanDerails
                this.planCompleteDetails = res.data.biddingPlanCompleteDetails
                this.projectInfo = res.data.projectInfo
                this.queryParam = res.data
            }
        }).catch(res => {
            this.loading = false
        })
    }
}
</script>

<style scoped lang="less">
.box {
    width: 100%;
    height: 100%;
    background: white;
    padding: 30px;
    margin-bottom: 20px;
    // box-shadow: 10px 10px 5px #ccc;
    box-sizing: border-box;

    .title {
        margin-bottom: 20px;

        .minusicon {
            display: inline-block;

            .icon {
                transform: rotate(90deg);
                font-size: 20px;
                color: #048fe0;
            }
        }

        span {
            display: inline-block;
            font-size: 20px;
        }
    }

    .descriptions {
        padding: 20px;
        box-sizing: border-box;
    }
}
</style>
